<template>
    <div class="goShop">
        <div >
            <el-steps class="steps" :active="active" finish-status="success">
                <el-step title="申请开店"></el-step>
                <el-step title="开店须知"></el-step>
                <el-step title="店铺信息"></el-step>
                <el-step title="平台审核"></el-step>
                <el-step title="在线签约"></el-step>
            </el-steps>
            <div class="btn">
                <el-button class="btn3"  round  @click="turn()" >去开店</el-button><br>
                <div class="div1">
                    <el-input class="input" v-model="userCode" placeholder="如已申请开通店铺请输入编号查看审核进度"></el-input>
                    <el-button round type="primary" @click="goQuery()">查询</el-button>
                </div>
            </div>
        </div>
    </div>
</template>
<style scoped>
    .goShop{
        width: 800px;
        margin: 0 auto;
    }
    .steps{
        margin-top: 50px;
    }
    .input{
        text-align: center;
        width: 300px;
        margin-right: 20px;
    }
    .btn{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .btn3{
        margin-top: 198px;
        background-color: #5fc040;
        color: #fff;
        width: 150px;
    }
    .div1{
        margin-top: 20px;
    }
    button{
        width: 100px;
    }
</style>
<script>
    import {findByUserCode} from '@/api/shop'
    export default {
        data() {
            return {
                active: 0,
                userCode:null
            }
        },
        methods:{
            turn(){
                 this.$router.push({name: 'shopNotice',params:{}})
            },
            goQuery(){
                if (!this.userCode){
                    this.$message.error("请输入用户编号")
                    return;
                }
                findByUserCode(this.userCode).then(res =>{
                    if (!res.data){
                        this.$message.error("该编号尚未开通店铺")
                    }else{
                        this.$router.push({name: 'adminAudit',params:{temp:res.data,userCode:this.userCode}})
                    }
                })
            }
        }
    }
</script>
